#@datagrid()
#define head_foot()
<meta name="renderer" content="webkit"><!-- 默认用极速核 -->
<!-- <meta name="renderer" content="ie-comp">默认用ie兼容内核 -->
<!-- <meta name="renderer" content="ie-stand">默认用ie标准内核 -->
#end
#define content_header()
<h1>
    提现管理
    <small>withdraw tables</small>
</h1>
<ol class="breadcrumb">
    <li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li>
    <li><a href="/withdraw/">财务</a></li>
    <li class="active">提现管理</li>
</ol>
#end
#define content()
<div class="box">
    <div class="box-header">
        <!--选项卡-->
        #set(tabid="tabmypending_list")
        #include("_withdraw_navtab.html")
        <div class="row">
            <div class="col-md-5">
            </div>
            <div class="col-md-7">
                <form class="navbar-form navbar-right" action="/withdraw/mypending_list/1">
                    <div class="form-group">
                        <input type="text" name="word" class="form-control input-sm" placeholder="关键词..." title="会员ID" value="#(search_gword??)">
                    </div>
                    <button type="submit" class="btn btn-sm btn-default">查询</button>
                </form>
            </div>
        </div>
    </div>
    <!-- /.box-header -->
    <div class="box-body">
        <table class="xsui-datagrid table table-condensed table-bordered table-striped table-hover">
            <thead>
                <tr>
                    <th>#</th>
                    <th>提现单号</th>
                    <th>用户ID</th>
                    <th>会员名</th>
                    <th>手机号</th>
                    <th>账户余额</th>
                    <th>冻结余额</th>
                    <th>提现金额</th>
                    <th>收款账号</th>
                    <th>持卡人姓名</th>
                    <th>开户银行</th>
                    <th>提现说明</th>
                    <th>申请时间</th>
                </tr>
            </thead>
            <tbody>
                #for(x : listPage.getList())
                <tr data-key="#(x.id)">
                    <td class="xsui-rowid"></td>
                    <td>#(x.id)</td>
                    <td>#(x.user_id)</td>
                    <td>#(x.nickname)</td>
                    <td>#(x.mobile)</td>
                    <td>#(x.blance) <a class="btn-pass" href="/withdraw/doAudit?id=#(x.id)&status=1">[通过]</a> <a class="btn-rejected" href="/withdraw/doAudit?id=#(x.id)&status=2">[驳回]</a></td>
                    <td>#(x.frozen_blance)</td>
                    <td>#(x.amount)</td>
                    <td>#(x.account)</td>
                    <td>#(x.holder)</td>
                    <td>#(x.bank_name)</td>
                    <td>#(x.remark)</td>
                    <td>#(x.createTimeText)</td>
                </tr>
                #end
            </tbody>
        </table>
        <!--分页条-->
        #set(formaction="mypending_list")
        #include("_pagination.html")
    </div>
    <!-- /.box-body -->
</div>
<!-- /.box -->
<input type="hidden" id="code" value="#(code??)" />
#end
#define body_foot()
<script>
$('.btn-pass').click(function(){
	if(!confirm('您确定要审核通过吗？此操作无法撤销，请谨慎操作!')){
		return false;
	}
	var url=$(this).attr('href');
	var id=$(this).parentsUntil('tr').parent().data('key');
	var code=$('#code').val();
	layer.prompt({title: '['+id+'] 请输入操作密码：', formType: 1}, function(pass, index){
		if(!pass || pass!=code){
			layer.msg('操作密码错误!');
		}else{
			$.post(url,function(msg){
				console.log(msg);
				if(msg.result){
					location.reload();
				}else{
					layer.msg(msg.message);
				}
			})
			layer.close(index);
		}
	});
	return false;
})

$('.btn-rejected').click(function(){
	if(!confirm('您确定要审核驳回吗？此操作无法撤销，请谨慎操作!')){
		return false;
	}
	var url=$(this).attr('href');
	var id=$(this).parentsUntil('tr').parent().data('key');
	layer.prompt({title: '['+id+'] 请填写驳回原因：', formType: 2}, function(text, index){
	    layer.close(index);
    	$.post(url,{remark:text},function(msg){
    		console.log(msg);
    		if(msg.result){
    			location.reload();
    		}else{
    			layer.msg(msg.message);
    		}
    	})
	});
	return false;
})
</script>
#end
